package 线.泛型;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * 泛型练习
 * @author ycc
 * @date 2025/8/2
 */
public class Main {
    public static void main(String[] args) {
        System.out.println("hello world");
        ArrayList<Integer> list = new ArrayList<>();
        list.add(78);
        list.add(76);
        list.add(74);
        list.add(73);

        // 迭代器的方式实现
        Iterator<Integer> iterator = list.iterator();
        while(iterator.hasNext()) {
            System.out.println(iterator.next());
        }

    }
}
